home *** CD-ROM | disk | FTP | other *** search
-
- /// ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¯ <
- ///
- /// More includes <
- ///
- /// ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡´ <
- ///
-
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// exec.library <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <clib/exec_protos.h>
- #include <pragmas/exec_sysbase_pragmas.h>
- #include <exec/types.h>
- #include <exec/ports.h>
- #include <exec/nodes.h>
- #include <exec/alerts.h>
- #include <exec/memory.h>
- #include <exec/execbase.h>
-
- IMPORT struct ExecBase *SysBase; // Always opened
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// Files management - dos.library <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <clib/dos_protos.h>
- #include <pragmas/dos_pragmas.h>
- #include <dos.h>
- #include <dos/dostags.h>
-
- IMPORT struct Library *DOSBase; // Opened with SASC compiler link code
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// intuition.library <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <clib/intuition_protos.h>
- #include <pragmas/intuition_pragmas.h>
-
- #define INTUITION_LIBRARY_NAME "intuition.library"
- #define INTUITION_LIBRARY_VERSION 36L
-
- STATIC struct Library *IntuitionBase = NULL;
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// icon.library <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <proto/icon.h> // Opened with SASC compiler link code
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// commodities.library <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <proto/commodities.h> // Opened with SASC compiler link code
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// xpkmaster.library <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <pragma/xpkmaster_lib.h>
-
- #define XPK_LIBRARY_NAME "xpkmaster.library"
- #define XPK_LIBRARY_VERSION 4L
-
- STATIC struct Library *XpkBase = NULL;
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// Localization support - locale.library <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <libraries/locale.h>
- #include <clib/locale_protos.h>
- #include <pragmas/locale_pragmas.h>
-
- #define LOCALE_LIBRARY_NAME "locale.library"
- #define LOCALE_LIBRARY_VERSION 38L
- #define CATALOG_LAST_VERSION 2
-
- STATIC struct Library *LocaleBase = NULL;
- STATIC struct Catalog *catalog = NULL;
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- /// and some other... <
- ///
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- #include <error.h>
- #include <string.h>
- #include <clib/alib_protos.h>
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- // Tags of used structures:
-
- // header of settings file
- struct SetsHeader
- {
- ULONG sh_ID;
- ULONG sh_version;
- ULONG sh_amount;
- };
-
- // header of pattern is settings file
- struct PatternHeader
- {
- unsigned ph_PatternMode : 2;
- unsigned ph_StorageMode : 2;
- unsigned ph_StorageMethod : 2;
- unsigned ph_PerformCheck : 1;
- unsigned ph_UseXPK : 1;
- unsigned ph_Function : 2;
- unsigned ph_pad : 6;
- UBYTE ph_XPKName[6];
- UWORD ph_XPKMode;
- UWORD ph_PatternSize;
- UWORD ph_StorageSize;
- UWORD ph_PasswordSize;
- };
-
- // work pattern's node
- struct PatternNode
- {
- struct Node pn_Node;
- unsigned pn_PatternMode : 2;
- unsigned pn_StorageMode : 2;
- unsigned pn_StorageMethod : 2;
- unsigned pn_PerformCheck : 1;
- unsigned pn_UseXPK : 1;
- unsigned pn_Function : 2;
- unsigned pn_pad : 6;
- UBYTE pn_XPKName[6];
- UWORD pn_XPKMode;
- UBYTE pn_Pattern[FMSIZE];
- UBYTE pn_Storage[FMSIZE];
- UBYTE pn_Password[32];
- UBYTE pn_Match[2*FMSIZE+8];
- };
-
- // all work buffers for any patched function
- struct WorkBuf
- {
- STRPTR wb_inbuf;
- LONG wb_inlen;
- UBYTE wb_path[FMSIZE];
- UBYTE wb_name[FMSIZE];
- UBYTE wb_dir[FMSIZE];
- UBYTE wb_spath[FMSIZE];
- UBYTE wb_sdir[FMSIZE];
- UBYTE wb_fault[2*FAULT_MAX];
- };
-
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- // Some macros:
-
- #define REG(x) register __ ## x
- #define GETMES(x) (messages[x])
- #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
-
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- // Some other defines:
-
- #define SETS_VERSION 2L
- #define SETS_ID MAKE_ID('A','M','I','R')
-
- #define ALL_RIGHT TRUE // ;-)
- #define GAME_OVER FALSE // :-(
-
- #define TASK_PREFS_NAME "AMIMIRRORPREFS"
- #define COM_PORT_NAME "AMIMIRROR_PORT"
- #define PREFS_PORT_NAME "AMIMIRRORPREFS_PORT"
- #define SETS_FILE "ENV:amimirror.sets"
- #define PREFS_TOOLTYPES "PREFS"
- #define PREFS_DEFAULT_PATH "Sys:Prefs/AmiMirrorPrefs"
-
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- // Named numeric constants:
-
- // work modes
- enum
- {
- FUNCTION_SPARE,
- FUNCTION_BACKUP,
- FUNCTION_ANTIDEL
- };
-
- // pattern modes
- enum
- {
- PAT_MODE_NAME,
- PAT_MODE_DIR,
- PAT_MODE_PATH
- };
-
- // storage modes
- enum
- {
- STO_MODE_FILE,
- STO_MODE_DIR
- };
-
- // storage methods
- enum
- {
- STO_METHOD_REPLACE,
- STO_METHOD_SUFFIX
- };
-
- // return values from some functions
- enum
- {
- FUNK_CANCEL,
- FUNK_YES,
- FUNK_NO
- };
-
- // catalog's messages
- enum
- {
- PROG_VERSION,
- PROG_COPYRIGHT,
- CATALOG_NAME,
- BUILTIN_LANGUAGE,
- PROG_DESC,
- REQ_TITLE_ERROR,
- OUT_MEM,
- LIBRARY_PROBLEM,
- DOS_ERROR_STR,
- CANT_LOCK,
- CANT_CREATE,
- CANT_OPEN_SETS,
- CANT_READ_SETS,
- NOT_SETS_FILE,
- CANT_PARSE,
- CANT_MSGPORT,
- CANT_OPEN,
- CANT_EXAM,
- CANT_EXAMXPK,
- CANT_READ,
- CANT_DELETE,
- CANT_RENAME,
- CANT_WRITE,
- CANT_PACK,
- CANT_UNPACK,
- QUIT_BUT,
- CANCEL_BUT,
- OK_BUT,
-
- FINISH,
- };
-
- ///¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ <
- ///
- // Global data:
-
- // catalog's strings
- STATIC STRPTR messages[] =
- {
- "$VER: AmiMirror 2.0 (19.05.99)",
- "AmiMirror © 1998-99 Black Square Software",
- "amimirror.catalog",
- "english",
- "Spare/backup/antidelete copies.",
- "AmiMirror error",
- "Not enough memory",
- "Can not open %s version %ld+",
- "\nDOS Error",
- "Cannot lock\n%s%s",
- "Cannot create\n%s%s",
- "Cannot open settings file\n%s%s",
- "Cannot read settings file\n%s%s",
- "Wrong settings file\n%s",
- "Cannot prepare pattern\n%s%s",
- "Cannot create message port",
- "Cannot open file\n%s%s",
- "Cannot examine file\n%s%s",
- "Cannot examine file\n%s\nXPK Error: %s",
- "Cannot read file\n%s%s",
- "Cannot delete file\n%s%s",
- "Cannot rename file\n%s%s",
- "Cannot write file\n%s%s",
- "Cannot pack\nXPK Error: %s",
- "Cannot unpack file\n%s\nXPK Error: %s",
- "Quit",
- "Cancel",
- "Ok"
- };
-
- // patch functions
- extern LONG __far LVOClose;
- extern LONG __far LVOOpen;
- extern LONG __far LVODeleteFile;
- STATIC LONG __asm (*OldClose)(register __d1 BPTR);
- STATIC BPTR __asm (*OldOpen)(register __d1 STRPTR, register __d2 LONG);
- STATIC BOOL __asm (*OldDeleteFile)(register __d1 STRPTR);
-
- // program data and buffers
- STATIC STRPTR *ttypes;
- STATIC struct List PatList;
- STATIC struct SignalSemaphore Sema;
- STATIC BOOL patch = FALSE;
-
- // commodity data
- STATIC CxObj *broker;
- STATIC struct MsgPort *broker_mp;
- STATIC ULONG cxsigflag = 0L;
- STATIC struct NewBroker newbroker =
- {
- NB_VERSION,
- "AmiMirror",
- "AmiMirror",
- NULL,
- NBU_UNIQUE | NBU_NOTIFY,
- COF_SHOW_HIDE,
- 0,
- NULL,
- 0
- };
-
- // compiler data
- IMPORT LONG __stack = 8192L;
- IMPORT LONG __STKNEED = 2048L;
- IMPORT UBYTE __stdiowin[] = "CON:10/10/200/80/AmiMirror";
-